<?php
namespace Models;
class CommonModel {

    protected $db;
    public function __construct()
    {
        try {
            $dns = 'mysql:host=localhost;dbname=shumeitieba;charset=utf8';
            $this->db = new \PDO($dns, 'root', '123456');
            $this->db->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC);
        } catch (\PDOException $e) {
            exit($e->getMessage());
        }
    }
}